package cd.cdyb.sms.dao;

import cd.cdyb.sms.domain.Template;
import cd.cdyb.sms.dto.expand.ExTemplateDto;
import cd.cdyb.sms.dto.query.QueryTemplateDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface TemplateDao extends BaseMapper<Template> {

    /**
     * 列表
     */
    IPage<ExTemplateDto> findTemplatePage(@Param("queryTemplateDto") QueryTemplateDto queryTemplateDto, @Param("page") Page<Template> page);

    /**
     * 详情
     */
    ExTemplateDto getTemplateById(@Param("templateId") Integer templateId);


    @Select("select * from template where number = #{number} and is_deleted = false")
    ExTemplateDto getTemplateByNumber(@Param("number") String number);

}
